

<!DOCTYPE html>
<html lang="en" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/my_blog/img/favicon.ico">
  <link rel="icon" type="image/png" href="/my_blog/img/favicon.ico">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  <title>图解辅助线的原理和画法 - Defame。</title>

  <link  rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/my_blog/lib/hint/hint.min.css" />

  
    
    <link  rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/10.0.0/styles/github-gist.min.css" />
  

  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_6peoq002giu.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_pjno9b9zyxs.css">


<link  rel="stylesheet" href="/my_blog/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script  src="/my_blog/js/utils.js" ></script>
  <script  src="/my_blog/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 4.2.1"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/my_blog/">&nbsp;<strong>Defame。</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my_blog/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my_blog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my_blog/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my_blog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my_blog/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner intro-2" id="background" parallax=true
         style="background: url('/my_blog/img/jq.jpg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container page-header text-center fade-in-up">
            <span class="h2" id="subtitle">
              
            </span>

            
              
  <div class="mt-3 post-meta">
    <i class="iconfont icon-date-fill" aria-hidden="true"></i>
    <time datetime="2020-10-15 16:27" pubdate>
      October 15, 2020 pm
    </time>
  </div>


<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      988 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      12
       分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid">
  <div class="row">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-md">
      <div class="container nopadding-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto" id="post">
            <!-- SEO header -->
            <h1 style="display: none">图解辅助线的原理和画法</h1>
            
            <div class="markdown-body" id="post-body">
              <h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><h4 id="前端实战：苦练-CSS-基本功——图解辅助线的原理和画法"><a href="#前端实战：苦练-CSS-基本功——图解辅助线的原理和画法" class="headerlink" title="前端实战：苦练 CSS 基本功——图解辅助线的原理和画法"></a>前端实战：苦练 CSS 基本功——图解辅助线的原理和画法</h4><img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/4213326384-5e13c4efb1b6c_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<br>
<br>
在用 CSS 进行绘图和布局时，除了借助浏览器开发工具之外，还经常需要绘制一些辅助线，以便定位参考。
<br>
<br>
为了使辅助线明显可见，把线的颜色设置为和背景对比强烈的白色，并且线也粗一些，在实际使用时，你应该降低辅助线与背景的对比并且使用细线。

<h3 id="分步图解"><a href="#分步图解" class="headerlink" title="分步图解"></a>分步图解</h3><h4 id="1、定义容器"><a href="#1、定义容器" class="headerlink" title="1、定义容器"></a>1、定义容器</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">font-size</span>: <span class="hljs-number">50px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">6em</span>;
    <span class="hljs-attribute">height</span>: <span class="hljs-number">4em</span>;
    <span class="hljs-attribute">background-color</span>: teal;
&#125;</code></pre>
<p>假设你有一个 div 容器，容器里是否有元素都可以，当前演示为了突显辅助线，暂时让容器里空空如也：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/1419950983-5e13c4ffd5046_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="2、一条基本的横线"><a href="#2、一条基本的横线" class="headerlink" title="2、一条基本的横线"></a>2、一条基本的横线</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-image</span>: <span class="hljs-built_in">linear-gradient</span>(to bottom, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>);
&#125;</code></pre>
<p>网格线是一条一条线条组成的，所以要先画出一条线，它的95%都是透明的，只有5%是白色的：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/2545990545-5e13c507a1d55_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="3、一条有尺寸的横线"><a href="#3、一条有尺寸的横线" class="headerlink" title="3、一条有尺寸的横线"></a>3、一条有尺寸的横线</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-size</span>: <span class="hljs-number">1em</span> <span class="hljs-number">1em</span>;
    <span class="hljs-attribute">background-repeat</span>: no-repeat;
&#125;</code></pre>
<p>请把绘制网格线想象成是铺地砖，首先要定义地砖的尺寸，这里用 1em 1em 定义了一块方砖，同时让砖块不重复，所以只显示出了孤单的一块砖：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/2635935660-5e13c50f86846_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="4、横向平铺地砖"><a href="#4、横向平铺地砖" class="headerlink" title="4、横向平铺地砖"></a>4、横向平铺地砖</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-repeat</span>: repeat-x;
&#125;</code></pre>
<p>如果把地砖横向平铺，就能组合成一条水平线：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/1917915264-5e13c517f29f4_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="5、纵向平铺地砖"><a href="#5、纵向平铺地砖" class="headerlink" title="5、纵向平铺地砖"></a>5、纵向平铺地砖</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-repeat</span>: repeat-y;
&#125;</code></pre>
<p>如果把地砖纵向平铺，就能组合成一条垂直线。<br>错！<br>纵向平铺是像阶梯一样的效果：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/3732563061-5e13c51f6cf16_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="6、横向和纵向同时平铺地砖"><a href="#6、横向和纵向同时平铺地砖" class="headerlink" title="6、横向和纵向同时平铺地砖"></a>6、横向和纵向同时平铺地砖</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-repeat</span>: repeat;
&#125;</code></pre>
<p>横向和纵向同时平铺，就是像作业本一样的多条横线效果。注意，这时最顶端是没有线的：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/1136616941-5e13c52793536_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="7、竖线平铺效果"><a href="#7、竖线平铺效果" class="headerlink" title="7、竖线平铺效果"></a>7、竖线平铺效果</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-image</span>: <span class="hljs-built_in">linear-gradient</span>(to right, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>);
    <span class="hljs-attribute">background-size</span>: <span class="hljs-number">1em</span> <span class="hljs-number">1em</span>;
    <span class="hljs-attribute">background-repeat</span>: repeat;
&#125;</code></pre>
<p>假如把地砖换成向右的竖线，即只把 to bottom 改为 to right ，其他不变，绘制出的就是一排一排的竖线。同样注意，这时最左边是没有线的：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/3694323145-5e13c5307b203_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="8、不完美的网格线"><a href="#8、不完美的网格线" class="headerlink" title="8、不完美的网格线"></a>8、不完美的网格线</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-image</span>:
        <span class="hljs-built_in">linear-gradient</span>(to bottom, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>),
        <span class="hljs-built_in">linear-gradient</span>(to right, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>);
    <span class="hljs-attribute">background-size</span>: <span class="hljs-number">1em</span> <span class="hljs-number">1em</span>;
    <span class="hljs-attribute">background-repeat</span>: repeat;
&#125;</code></pre>
<p>把第6步和第7步合并起来，网格线基本成型了，不过顶端和左端还缺少线条：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/3791823455-5e13c53973a20_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="9、一段顶端线"><a href="#9、一段顶端线" class="headerlink" title="9、一段顶端线"></a>9、一段顶端线</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-image</span>: 
        <span class="hljs-built_in">linear-gradient</span>(to top, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>);
    <span class="hljs-attribute">background-size</span>: <span class="hljs-number">1em</span> <span class="hljs-number">1em</span>;
    <span class="hljs-attribute">background-repeat</span>: no-repeat;
&#125;</code></pre>
<p>来解决顶端线的问题，先画出一段顶端线。这段代码和第3步极相似，仅仅是 to bottom 改成了 to top：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/3264344301-5e13c542c7db8_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="10、一条顶端线"><a href="#10、一条顶端线" class="headerlink" title="10、一条顶端线"></a>10、一条顶端线</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-repeat</span>: repeat-x;
&#125;</code></pre>
<p>把这一段顶端线水平平铺，就是一条定位在顶部的水平线：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/2555368612-5e13c54aeaf32_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="11、一段左端线"><a href="#11、一段左端线" class="headerlink" title="11、一段左端线"></a>11、一段左端线</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-image</span>: 
        <span class="hljs-built_in">linear-gradient</span>(to left, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>);
    <span class="hljs-attribute">background-size</span>: <span class="hljs-number">1em</span> <span class="hljs-number">1em</span>;
    <span class="hljs-attribute">background-repeat</span>: no-repeat;
&#125;</code></pre>
<p>用类似的办法解决左端线问题，先定义一段左端线，注意 linear-gradient 函数的第 1 个参数改成 to left 了：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/3222043821-5e13c55326e91_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="12、一条左端线"><a href="#12、一条左端线" class="headerlink" title="12、一条左端线"></a>12、一条左端线</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span> &#123;
    <span class="hljs-attribute">background-repeat</span>: repeat-y;
&#125;</code></pre>
<p>平铺这段左端线，就得到了一条紧挨容器左侧的竖线：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/1293770780-5e13c566d7c02_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<h4 id="13、All-in-one-的完美效果"><a href="#13、All-in-one-的完美效果" class="headerlink" title="13、All in one 的完美效果"></a>13、All in one 的完美效果</h4><pre><code class="hljs css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-pseudo">:nth-child(13)</span> &#123;
    <span class="hljs-attribute">background-image</span>: 
        <span class="hljs-built_in">linear-gradient</span>(to bottom, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>),
        <span class="hljs-built_in">linear-gradient</span>(to right, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>),
        <span class="hljs-built_in">linear-gradient</span>(to top, transparent <span class="hljs-number">95%</span>, w hite <span class="hljs-number">95%</span>),
        <span class="hljs-built_in">linear-gradient</span>(to left, transparent <span class="hljs-number">95%</span>, white <span class="hljs-number">95%</span>);
    <span class="hljs-attribute">background-size</span>: <span class="hljs-number">1em</span> <span class="hljs-number">1em</span>;
    <span class="hljs-attribute">background-repeat</span>: repeat, repeat, repeat-x, repeat-y;</code></pre>
<p>好了，我们把第8步不完美的网格线、顶端线、左端线都合起来，就是完美的网格线了，注意 background-repeart 的写法，它有 4 个参数，分别对应 background-image 里的 4 条线：</p>
<img src="/my_blog/2020/10/15/%E5%9B%BE%E8%A7%A3%E8%BE%85%E5%8A%A9%E7%BA%BF%E7%9A%84%E5%8E%9F%E7%90%86%E5%92%8C%E7%94%BB%E6%B3%95/4213326384-5e13c4efb1b6c_articlex.png" srcset="/my_blog/img/loading.gif" class title="This is an example image">
<br>
<br>
干得漂亮！收工。

<h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><h4 id="·《CSS3-艺术》第4-1-2节，背景图片-background-image"><a href="#·《CSS3-艺术》第4-1-2节，背景图片-background-image" class="headerlink" title="·《CSS3 艺术》第4.1.2节，背景图片 background-image"></a>·《CSS3 艺术》第4.1.2节，背景图片 background-image</h4><h4 id="·《CSS3-艺术》第4-1-4节，背景尺寸-background-size"><a href="#·《CSS3-艺术》第4-1-4节，背景尺寸-background-size" class="headerlink" title="·《CSS3 艺术》第4.1.4节，背景尺寸 background-size"></a>·《CSS3 艺术》第4.1.4节，背景尺寸 background-size</h4><h4 id="·《CSS3-艺术》第4-1-5节，背景平铺-background-repeat"><a href="#·《CSS3-艺术》第4-1-5节，背景平铺-background-repeat" class="headerlink" title="·《CSS3 艺术》第4.1.5节，背景平铺 background-repeat"></a>·《CSS3 艺术》第4.1.5节，背景平铺 background-repeat</h4><h4 id="·《CSS3-艺术》第4-2节，线性渐变-linear-gradient"><a href="#·《CSS3-艺术》第4-2节，线性渐变-linear-gradient" class="headerlink" title="·《CSS3 艺术》第4.2节，线性渐变 linear-gradient()"></a>·《CSS3 艺术》第4.2节，线性渐变 linear-gradient()</h4>
            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/my_blog/categories/CSS/">CSS</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/my_blog/tags/CSS/">CSS</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" target="_blank" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！</p>
              
              
                <div class="post-prevnext row">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/my_blog/2020/11/17/%E9%87%8D%E6%96%B0%E8%AE%A4%E8%AF%86HTML5/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">重新认识HTML5</span>
                        <span class="visible-mobile">Previous</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/my_blog/2020/08/25/%E5%AF%B9%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%BC%96%E7%A8%8B%E7%9A%84%E7%90%86%E8%A7%A3/">
                        <span class="hidden-mobile">对面向对象编程的理解</span>
                        <span class="visible-mobile">Next</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments">
                
                
  <div class="disqus" style="width:100%">
    <div id="disqus_thread"></div>
    <script type="text/javascript">
      function loadDisqus() {
        var disqus_config = function () {
          this.page.url = 'https://defame.gitee.io/my_blog/2020/10/15/图解辅助线的原理和画法/';
          this.page.identifier = '/2020/10/15/图解辅助线的原理和画法/';
        };
        (function () {
          var d = document,
            s = d.createElement('script');
          s.src = '//' + '' + '.disqus.com/embed.js';
          s.setAttribute('data-timestamp', new Date());
          (d.head || d.body).appendChild(s);
        })();
      }
      waitElementVisible('disqus_thread', loadDisqus);
    </script>
    <noscript>Please enable JavaScript to view the
      <a href="https://disqus.com/?ref_noscript" target="_blank" rel="nofollow noopener noopener">comments powered by Disqus.</a>
    </noscript>
  </div>


              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;TOC</p>
  <div id="tocbot"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">Search</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">keyword</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  

  <footer class="mt-5">
  <div class="text-center py-3">
    <div>
      <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
      <i class="iconfont icon-love"></i>
      <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener">
        <span>Fluid</span></a>
    </div>
    
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


    
  <!-- 备案信息 -->
  <div class="beian">
    <a href="http://beian.miit.gov.cn/" target="_blank"
       rel="nofollow noopener">京ICP证123456号</a>
    
      <a
        href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=12345678"
        rel="nofollow noopener"
        class="beian-police"
        target="_blank"
      >
        <span class="beian-police-sep">&nbsp;|&nbsp;</span>
        
          <img src="/my_blog/img/police_beian.png" srcset="/my_blog/img/loading.gif" alt="police-icon" />
        
        <span>京公网安备12345678号</span>
      </a>
     
  </div>


    
  </div>
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/my_blog/js/debouncer.js" ></script>
<script  src="/my_blog/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/my_blog/js/lazyload.js" ></script>
  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/my_blog/js/clipboard-use.js" ></script>



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





  <script  src="https://cdn.staticfile.org/tocbot/4.11.1/tocbot.min.js" ></script>
  <script>
    $(document).ready(function () {
      var boardCtn = $('#board-ctn');
      var boardTop = boardCtn.offset().top;

      tocbot.init({
        tocSelector: '#tocbot',
        contentSelector: '#post-body',
        headingSelector: 'h1,h2,h3,h4,h5,h6',
        linkClass: 'tocbot-link',
        activeLinkClass: 'tocbot-active-link',
        listClass: 'tocbot-list',
        isCollapsedClass: 'tocbot-is-collapsed',
        collapsibleClass: 'tocbot-is-collapsible',
        collapseDepth: 0,
        scrollSmooth: true,
        headingsOffset: -boardTop
      });
      if ($('.toc-list-item').length > 0) {
        $('#toc').css('visibility', 'visible');
      }
    });
  </script>



  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    var typed = new Typed('#subtitle', {
      strings: [
        '  ',
        "图解辅助线的原理和画法&nbsp;",
      ],
      cursorChar: "_",
      typeSpeed: 70,
      loop: false,
    });
    typed.stop();
    $(document).ready(function () {
      $(".typed-cursor").addClass("h2");
      typed.start();
    });
  </script>



  <script  src="https://cdn.staticfile.org/anchor-js/4.2.2/anchor.min.js" ></script>
  <script>
    anchors.options = {
      placement: "right",
      visible: "hover",
      
    };
    var el = "h1,h2,h3,h4,h5,h6".split(",");
    var res = [];
    for (item of el) {
      res.push(".markdown-body > " + item)
    }
    anchors.add(res.join(", "))
  </script>



  <script  src="/my_blog/js/local-search.js" ></script>
  <script>
    var path = "/my_blog/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>



  <script  src="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.css" />

  <script>
    $('#post img:not(.no-zoom img, img[no-zoom]), img[zoom]').each(
      function () {
        var element = document.createElement('a');
        $(element).attr('data-fancybox', 'images');
        $(element).attr('href', $(this).attr('src'));
        $(this).wrap(element);
      }
    );
  </script>







  
  
    <script>
      !function (e, t, a) {
        function r() {
          for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
          requestAnimationFrame(r)
        }

        function n() {
          var t = "function" == typeof e.onclick && e.onclick;
          e.onclick = function (e) {
            t && t(), o(e)
          }
        }

        function o(e) {
          var a = t.createElement("div");
          a.className = "heart", s.push({
            el: a,
            x: e.clientX - 5,
            y: e.clientY - 5,
            scale: 1,
            alpha: 1,
            color: c()
          }), t.body.appendChild(a)
        }

        function i(e) {
          var a = t.createElement("style");
          a.type = "text/css";
          try {
            a.appendChild(t.createTextNode(e))
          } catch (t) {
            a.styleSheet.cssText = e
          }
          t.getElementsByTagName("head")[0].appendChild(a)
        }

        function c() {
          return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
        }

        var s = [];
        e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
          setTimeout(e, 1e3 / 60)
        }, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r()
      }(window, document);
    </script>
  














<script src="/my_blog/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
